package _07_priority_queue.my_implements.heap;

import _07_priority_queue.my_implements.Entity;
import org.junit.Test;

/**
 * @author: mornd
 * @dateTime: 2023/6/8 - 21:42
 */
public class MyTest {
    @Test
    public void test() {
//        AbstractPriorityHeap<Entity> queue = new MaxHeap<>(5);
        AbstractPriorityHeap<Entity> queue = new MinHeap<>(5);
        queue.offer(new Entity("a", 1));
        queue.offer(new Entity("b", 3));
        queue.offer(new Entity("c", 5));
        queue.offer(new Entity("d", 4));
        queue.offer(new Entity("e", 4));
        queue.offer(new Entity("f", 6));

//        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.isEmpty());

    }
}
